package com.zcckj.demo.storage.controller;

import com.zcckj.demo.storage.model.dto.ReduceStockDTO;
import com.zcckj.demo.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * <p>
 *  TODO 类作用描述
 * </p>
 *
 * @author zhangjie
 * @since 2019-08-29
 */
@RestController
@RequestMapping("/storage")
public class StorageController {

    @Autowired
    private StorageService storageService;

    @RequestMapping("/reduce")
    public Boolean reduceStock(@RequestBody @Validated ReduceStockDTO reduceStockDTO){
        return storageService.reduceStock(reduceStockDTO);
    }
}
